<?php
/**
 * Dao of Customer
 *
 * @author fsqijy
 */
require_once BaseUtil::getModulePath("base") . '/models/BaseDao.php';
class AreaDao extends BaseDao{
    protected $_name;
    public function  _setup() {
        $this->_name = $this->prefix() . "area_dicts";
        parent::_setup();
    }
    public function getAllProvince(){
        $select = $this->db_r->select();
        $select->from($this->_name,"*");
        $select->where("is_delete = 0");
        $select->where("level  = 1 ");
        $sql = $select->__toString();
        return $this->db_r->fetchAll($sql);
    }
    
    public function getDictTitleById($dict_id){
    	$select = $this->db_r->select();
        $select->from($this->_name,"title");
        $select->where("id = ?",$dict_id);
        $select->where("is_delete = 0");
        $sql = $select->__toString();
        return $this->db_r->fetchOne($sql);
    }
}
